package server

import (
	"context"

	hpb "gitee.com/jnshao/go-start/proto/tools/api"
)

type helloServer struct {
	hpb.UnimplementedGreeterServer
}

func NewHelloServer() *helloServer {
	return &helloServer{}
}

func (s *helloServer) SayHello(ctx context.Context, in *hpb.HelloRequest) (*hpb.HelloReply, error) {
	return &hpb.HelloReply{Message: "Hello " + in.Name}, nil
}

func (s *helloServer) SayHelloAgain(ctx context.Context, in *hpb.HelloRequest) (*hpb.HelloReply, error) {
	return &hpb.HelloReply{Message: "Hello " + in.Name + "again"}, nil
}
